using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.ApplicationBlocks.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace DataHelper.DAL
{
    public class BK_Passenger
    {
private static  string m_trConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

       #region BK_PassengerSelectAll
        public static SqlDataReader BK_PassengerSelectAll(string strSearch="",int top = 1, int bottom = 20, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
                return SqlHelper.ExecuteReader(ConnectionString, "BK_PassengerSelectAllRows",strSearch,top,bottom);
            return SqlHelper.ExecuteReader(m_trConnectionString, "BK_PassengerSelectAllRows",strSearch,top,bottom);
        }
        #endregion
       #region BK_PassengerSelectRow
        public static SqlDataReader BK_PassengerSelectRow(int ID, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
                return SqlHelper.ExecuteReader(ConnectionString, "BK_PassengerSelectRow", ID);
            return SqlHelper.ExecuteReader(m_trConnectionString, "BK_PassengerSelectRow", ID);
        }
        #endregion
       #region BK_PassengerInsertRow
        public static void BK_PassengerInsertRow(int ID, int TypeID, string Name, string FirstName, DateTime Birthday, string Sex, string Address, string City, int TK_CountryID, int TK_ProvineID, string Email, string Phone, string PassportNo, int PassportCountryID, DateTime PassportExp, int NationnalityID, DateTime CreatedDate, bool IsDeleted, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "BK_PassengerInsertRow", ID, TypeID, Name, FirstName, Birthday, Sex, Address, City, TK_CountryID, TK_ProvineID, Email, Phone, PassportNo, PassportCountryID, PassportExp, NationnalityID, CreatedDate, IsDeleted);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "BK_PassengerInsertRow", ID, TypeID, Name, FirstName, Birthday, Sex, Address, City, TK_CountryID, TK_ProvineID, Email, Phone, PassportNo, PassportCountryID, PassportExp, NationnalityID, CreatedDate, IsDeleted);
        }
        #endregion
       #region BK_PassengerUpdateRow
        public static void BK_PassengerUpdateRow(int ID, int TypeID, string Name, string FirstName, DateTime Birthday, string Sex, string Address, string City, int TK_CountryID, int TK_ProvineID, string Email, string Phone, string PassportNo, int PassportCountryID, DateTime PassportExp, int NationnalityID, DateTime CreatedDate, bool IsDeleted, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "BK_PassengerUpdateRow", ID, TypeID, Name, FirstName, Birthday, Sex, Address, City, TK_CountryID, TK_ProvineID, Email, Phone, PassportNo, PassportCountryID, PassportExp, NationnalityID, CreatedDate, IsDeleted);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "BK_PassengerUpdateRow", ID, TypeID, Name, FirstName, Birthday, Sex, Address, City, TK_CountryID, TK_ProvineID, Email, Phone, PassportNo, PassportCountryID, PassportExp, NationnalityID, CreatedDate, IsDeleted);
        }
        #endregion
       #region BK_PassengerDeleteRow
        public static void BK_PassengerDeleteRow(int ID, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "BK_PassengerDeleteRow", ID);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "BK_PassengerDeleteRow", ID);
        }
        #endregion

    }
}

